<?php
header('Content-Type:text/html;charset=utf-8');
require 'functions.php';
$user="1661993235";
$pass='123abcde';
if($user=='' || $pass==''){
    echo '参数不完整';
}else{
    if(is_dir("userwfwht/$user")){
        if($pass==file_get_contents("userwfwht/$user/password")){
                $arr=arrdir("tz");
                rsort($arr);
                if(count($arr)>0){
                    for($i=0;$i<count($arr);$i++){
                        $id=$arr[$i];
                        $bt=file_get_contents("tz/$id/bt");
                        $nr=file_get_contents("tz/$id/nr");
                        $nc=file_get_contents("tz/$id/nc");
                        $sj=file_get_contents("tz/$id/sj");
                        $jg=['msg'=>"查询成功",'bt'=>$bt,'nr'=>$nr,'nc'=>$nc,'sj'=>$sj];
                        echo json_encode($jg,JSON_UNESCAPED_UNICODE);
                    }
                }else{
                    $jg=['msg'=>"查询失败",'yy'=>"官方无通知"];
                    echo json_encode($jg,JSON_UNESCAPED_UNICODE);
                }
        }else{
            $jg=['msg'=>"查询失败",'yy'=>"密码错误"];
            echo json_encode($jg,JSON_UNESCAPED_UNICODE);
        }
    }else{
        $jg=['msg'=>"查询失败",'yy'=>"账号不存在"];
        echo json_encode($jg,JSON_UNESCAPED_UNICODE);
    }
}